package Exercise;
//对称字符串
import java.util.Scanner;
public class String_4 {
    public static void main(String[] args) {
        //用户输入
        Scanner sc = new Scanner (System.in);
        System.out.println("请输入字符串：");
        String sr = sc.next();
        //反转
        StringBuilder sb = new StringBuilder();
        String newsr = sb.append(sr).reverse().toString();
        //比较
        if(sr.equals(newsr)){
            System.out.println("该字符串为对称字符串");
        }else{
            System.out.println("该字符串不是对称字符串");
        }
    }
}
